<?php
/* @var $this ServicePriceController */
/* @var $model ServicePrice */

$this->breadcrumbs=array(
        'Háztömb' => array('block/index'),
        $block->name => array('block/update','id'=>$block->id),
        'Szolgáltatók' => array('block/update','id'=>$block->id),
        $provider->name => array('provider/update', 'id'=>$provider->id, 'blockId'=>$block->id),
        'Árak'
);

?>


<fieldset>

    <?php

    $this->widget('bootstrap.widgets.BootGridView', array(
            'id'=>'servicePrice-grid',
            'summaryText'=>'',
            'dataProvider'=>$model->search(),
            'emptyText'=>'Nincs ár',
            'filter'=>$model,
            'columns'=>array(
                    array(
                            'name'=>'name',
                            'filter'=>CHtml::activeDateField($model, 'fromDate'),
                            'value'=>'$data->fromDate',
                    ),
                    array(
                            'name'=>'price',
                            'type'=>'raw',
                            'filter'=>CHtml::activeTextField($model, 'price'),
                            'value'=>'$data->price ." <span>HUF/m&sup2;</span>"',
                            'htmlOptions'=>array('style'=>'width: 200px; text-align:right;')
                    ),
                    array(
                            'class'=>'bootstrap.widgets.BootButtonColumn',
                            'template' => '{update} {delete}',
                            'buttons' => array(
                                    'update' => array(
                                            'visible'=>'checkAccess("ServicePrice.Update")',
                                            'url'=>'createUrl("servicePrice/update", array("id"=>$data->id, "providerId"=>'.$provider->id.', "blockId"=> '.$block->id.'))',
                                            'label'=> 'Szerkeszt',
                                            'options'=>array(
                                                    'class'=>'btn btn-small update'
                                            )
                                    ),
                                    'delete' => array(
                                            'visible'=>'checkAccess("ServicePrice.Delete")',
                                            'url'=>'createUrl("servicePrice/delete", array("id"=>$data->id, "providerId"=>'.$provider->id.', "blockId"=> '.$block->id.'))',
                                            'label'=> 'Töröl',
                                            'options'=>array(
                                                    'class'=>'btn btn-small delete'
                                            )
                                    ),
                            ),
                            'htmlOptions'=>array('style'=>'width: 125px'),
                    )

            )
    ));

    ?>

    <div class="form-actions">
        <?php

        echo CHtml::link('Új ár', array('servicePrice/create', 'providerId'=>$provider->id, 'blockId'=>$block->id), array('class'=>'btn btn-info'));

        echo hyperlink('Vissza', $this->createUrl('block/update', array('id'=>$block->id)) . '#providers');
        ?>
    </div>

</fieldset>
